List & Label .NET
Programming Introduction / Other Important Concepts / Error Handling with Exceptions
In This Topic
    Error Handling with Exceptions
    In This Topic

    List & Label defines a number of internal exceptions, which are all derived from the common base class ListLabelException and therefore can be caught at a central location. If the application is supposed to carry out its own Exception handling, calls to List & Label can be enclosed by an Exception handler. The Message property of the Exception class contains an error text, which is also generally localized and can be displayed directly to the user:

    ListLabel LL = null;
    try
    {
      LL = new ListLabel();
      LL.DataSource = CreateDataSet();
      LL.Design();
    }
    catch (ListLabelException ex)
    {
      MessageBox.Show(ex.Message);
    }
    finally
    {
      if(LL != null)
        LL.Dispose();
    }